package com.aizuda.boot.modules.business.comment.entity;


import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("contract_comment")
@Schema(description = "评论主表实体")
public class CommentEntity {

    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "评论ID（自动生成）", example = "1", accessMode = Schema.AccessMode.READ_ONLY)
    private Integer id;

    @TableField("contract_id")
    @Schema(description = "合同ID", example = "123456")
    private Integer contractId;

    @TableField("user_id")
    @Schema(description = "用户ID", example = "10001")
    private Long userId;

    @TableField("comment_text")
    @Schema(description = "评论内容", example = "这是一条测试评论")
    private String commentText;

    @TableField("parent_comment_id")
    @Schema(description = "父评论ID（用于回复）", example = "0")
    private Integer parentCommentId;

    @TableField("comment_type")
    @Schema(description = "评论类型：0-协商评论，1-审批评论", example = "0", allowableValues = "0,1")
    private Integer commentType;

    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @Schema(description = "创建时间（自动生成）", example = "2023-10-01 12:00:00", accessMode = Schema.AccessMode.READ_ONLY)
    private LocalDateTime createdAt;

    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间（自动生成）", example = "2023-10-01 12:05:00", accessMode = Schema.AccessMode.READ_ONLY)
    private LocalDateTime updatedAt;
}